home *** CD-ROM | disk | FTP | other *** search
-
-
-
- SEMGET C Library Procedures SEMGET
-
-
-
- NNAAMMEE
- semget - get set of semaphores
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
- ##iinncclluuddee <<ssyyss//iippcc..hh>>
- ##iinncclluuddee <<ssyyss//sseemm..hh>>
-
- iinntt sseemmggeett((kkeeyy,, nnsseemmss,, sseemmffllgg))
- kkeeyy__tt kkeeyy;;
- iinntt nnsseemmss,, sseemmffllgg;;
-
- DDEESSCCRRIIPPTTIIOONN
- sseemmggeett(()) returns the semaphore identifier associated with
- _k_e_y.
-
- A semaphore identifier and associated data structure and set
- containing _n_s_e_m_s semaphores (see iinnttrroo(2)) are created for
- _k_e_y if one of the following are true:
-
- o+ _k_e_y is equal to IIPPCC__PPRRIIVVAATTEE.
-
- o+ _k_e_y does not already have a semaphore identifier asso-
- ciated with it, and (_s_e_m_f_l_g & IIPPCC__CCRREEAATT) is ``true''.
-
- Upon creation, the data structure associated with the new
- semaphore identifier is initialized as follows:
-
- o+ sseemm__ppeerrmm..ccuuiidd, sseemm__ppeerrmm..uuiidd, sseemm__ppeerrmm..ccggiidd, and
- sseemm__ppeerrmm..ggiidd are set equal to the effective user ID and
- effective group ID, respectively, of the calling pro-
- cess.
-
- o+ The low-order 9 bits of sseemm__ppeerrmm..mmooddee are set equal to
- the low-order 9 bits of _s_e_m_f_l_g.
-
- o+ sseemm__nnsseemmss is set equal to the value of _n_s_e_m_s.
-
- o+ sseemm__oottiimmee is set equal to 0 and sseemm__ccttiimmee is set equal
- to the current time.
-
- RREETTUURRNN VVAALLUUEE
- Upon successful completion, a non-negative integer, namely a
- semaphore identifier, is returned. Otherwise, a value of -1
- is returned and eerrrrnnoo is set to indicate the error.
-
- EERRRROORRSS
- sseemmggeett(()) will fail if one or more of the following are true:
-
- EINVAL _n_s_e_m_s is either less than or equal to
- zero or greater than the system-imposed
- limit.
-
-
-
- Sprite v1.0 21 November 1987 1
-
-
-
-
-
-
- SEMGET C Library Procedures SEMGET
-
-
-
- EACCES A semaphore identifier exists for _k_e_y,
- but operation permission (see iinnttrroo(2))
- as specified by the low-order 9 bits of
- _s_e_m_f_l_g would not be granted.
-
- EINVAL A semaphore identifier exists for _k_e_y,
- but the number of semaphores in the set
- associated with it is less than _n_s_e_m_s
- and _n_s_e_m_s is not equal to zero.
-
- ENOENT A semaphore identifier does not exist
- for _k_e_y and (_s_e_m_f_l_g & IIPPCC__CCRREEAATT) is
- ``false''.
-
- ENOSPC A semaphore identifier is to be created
- but the system-imposed limit on the max-
- imum number of allowed semaphore iden-
- tifiers system wide would be exceeded.
-
- ENOSPC A semaphore identifier is to be created
- but the system-imposed limit on the max-
- imum number of allowed semaphores system
- wide would be exceeded.
-
- EEXIST A semaphore identifier exists for _k_e_y
- but ( (_s_e_m_f_l_g & IIPPCC__CCRREEAATT) and (_s_e_m_f_l_g &
- IIPPCC__EEXXCCLL))) is ``true''.
-
- SSEEEE AALLSSOO
- iinnttrroo(2), sseemmccttll(2), sseemmoopp(2)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v1.0 21 November 1987 2
-
-
-
-